<template>
  <el-dialog title="附件上传"
             :visible.sync="dialogForm"
             min-width="420px">
    <el-form :inline="true"
             ref="form"
             :model="form"
             class="add-form"
             label-min-width="110px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="附件"
                        class="customFormWidth">
            <attachments v-model="form.attachments"></attachments>
            <download v-model="form.attachments"></download>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item label="备注"
                      min-width="0px">
          <el-input v-model="form.remark"
                    placeholder="请输入内容"></el-input>
        </el-form-item>
      </el-row>
    </el-form>
    <div slot="footer"
         class="dialog-footer">
      <el-button type="primary"
                 @click="submit">确认</el-button>
      <el-button @click="dialogForm = false">取消</el-button>
    </div>
  </el-dialog>
</template>
<script>
import attachments from '@/components/file-upload'
import download from '@/components/download'

export default {
  name: 'updownDialogForm',
  components: { attachments, download },
  data() {
    return {
      form: this.clearForm(),
      dialogForm: false
    }
  },
  methods: {
      clearForm() {
      return {
          attachments:null,
          remark:''
      }
    },
    //上传附件之后确定
    submit() {
      console.log(this.form)
      this.$emit('load',this.form)
      this.dialogForm = false
    }
  }
}
</script>


